//
//  CTPickAlbumCell.m
//  ConstellationTalk_0.1
//
//  Created by riley on 15/5/16.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import "CTPickAlbumCell.h"
#import "CTDebugManager.h"
#import "CTHeader.h"
#import "CTPublishItems.h"

@interface CTPickAlbumCell ()
{
    UILabel * nameLabel;
    UIImageView * imageview;
}
@end


@implementation CTPickAlbumCell


- (void)dealloc
{
    [nameLabel removeFromSuperview];
    nameLabel = nil;
    
    [imageview removeFromSuperview];
    imageview = nil;
    
    
    [CTDebugManager showDebugLogInfo:@"dealloc : CTPickAlbumCell Is Removed!!!"];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        
        imageview = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 90, 90)];
        imageview.image = [UIImage imageNamed:@"faxianguanzhu@2x"];
        [self addSubview:imageview];
        
        nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(115,45, 200, 30)];
        nameLabel.textAlignment = NSTextAlignmentLeft;
        nameLabel.textColor = CT_HEADER_DEEPLINE_COLOR;
        nameLabel.font = [UIFont fontWithName:nil size:18];
        [self addSubview:nameLabel];
        
    }
    return self;
}


#pragma mark - setter -


-(void)setAlbumItem:(CTAlbumItem *)albumItem
{
    imageview.image = [UIImage imageWithCGImage:[albumItem.group posterImage]];
    
    nameLabel.text = [NSString stringWithFormat:@"%@(%@)",albumItem.groupName,albumItem.imgNumber];
}

@end
